0133711c3b6ef223fc1b6bff7ff90eecd32882bc,router/java/src/net/i2p/router/transport/UPnP.java,RegisterPortsThread,run,#,638
Before Change
} else {
HashMap<ForwardPort, ForwardPortStatus> map = new HashMap<ForwardPort, ForwardPortStatus>();
map.put(port, new ForwardPortStatus(ForwardPortStatus.PROBABLE_FAILURE, "UPnP port forwarding apparently failed", port.portNumber));
forwardCallback.portForwardStatus(map);
continue;
}
}
After Change
}
public void run() {
HashMap<ForwardPort, ForwardPortStatus> map = new HashMap(1);
for(ForwardPort port : portsToForwardNow) {
String proto = protoToString(port.protocol);
map.clear();
ForwardPortStatus fps;
if (proto.length() <= 1) {
fps = new ForwardPortStatus(ForwardPortStatus.DEFINITE_FAILURE, "Protocol not supported", port.portNumber);
} else if(tryAddMapping(proto, port.portNumber, port.name, port)) {
fps = new ForwardPortStatus(ForwardPortStatus.MAYBE_SUCCESS, "Port apparently forwarded by UPnP", port.portNumber);
} else {
fps = new ForwardPortStatus(ForwardPortStatus.PROBABLE_FAILURE, "UPnP port forwarding apparently failed", port.portNumber);
}
map.put(port, fps);
forwardCallback.portForwardStatus(map);
}
}
}